package com.example.hellotwo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;

public class MainActivity2 extends AppCompatActivity {
    private static final String TAG="MainActivity2";
    int score=0;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);
    }
    public void click(View btn){
        Log.i(TAG,"click");
        if(btn.getId()==R.id.a3){
            score+=3;
        }
        else if(btn.getId()==R.id.a4){
            score+=2;
        }
        else if(btn.getId()==R.id.a5){
            score+=1;
        }
        else{
            score=0;
        }
        TextView out=findViewById(R.id.a2);
        out.setText(String.valueOf(score));
    }
}